<template>
	<!-- 'backgroundColor': 'rgba(8,24,50,1)' -->
	<view :class="[ BackGround ]" :style="[{'font-weight':Style,'font-family':Font,}]">
		<cu-custom bgColor="bg-gradual-blue" isBack="true">
			<view slot="backText">返回</view>
			<view slot="content">设备维修</view>
		</cu-custom>
		<scroll-dome :list="list" @jumpArchives="jumpArchives" @zylongtap="zylongtap"></scroll-dome>
		<chunLei-popups v-model="value1" :popData="data1" @tapPopup="tapPopup" @zyinput="zyinput" :x="x" :y="y" placement="top-end"></chunLei-popups>
	</view>
</template>

<script>
	import chunLeiPopups from "@/colorui/components/chunLei-popups/chunLei-popups"
	import ScrollDome from '@/colorui/components/ScrollDome'
	import {
		mapGetters
	} from 'vuex'
	import {
		Commonly,
	} from "@/mixin/mixin.js"
	export default {
		mixins:[Commonly],
		data() {
			return {
				list: [{
					name: '设备档案',
					LMENUID:'970801',
					isShow:false,
					LFUNCNO:'9538',
					Children: [{
						img: "/static/images/archives.png",
						isShow:true,
						LFUNCNO:'9538',
						url:"./Repair/archives/archives",
						name: '设备档案',
					}],
					id: 0
				}, {
					name: '润滑管理',
					LMENUID:'970802',
					isShow:false,
					Children: [{
							img: "/static/images/Lubrication2.png",
							name: '润滑周期',
							LFUNCNO:'9539',
							isShow:false,
							url:"./Repair/period/period",
						},
						{
							img: "/static/images/Lubricationrecord.png",
							name: '润滑记录',
							LFUNCNO:'9554',
							isShow:false,
							url:"./Repair/lubrication/lubrication",
						}
					],
					id: 1
				}, {
					name: '揩车管理',
					LMENUID:'970803',
					isShow:false,
					Children: [{
							img: "/static/images/Wipingmanagement.png",
							name: '揩车周期',
							LFUNCNO:'9540',
							isShow:false,
							url:"./Repair/Wipe/Wipe",
						},
						{
							img: "/static/images/Wipingrecord.png",
							name: '揩车记录',
							LFUNCNO:'9555',
							isShow:false,
							url:"./Repair/WipeRecord/WipeRecord",
						}
					],
					id: 2
				}, {
					name: '修理管理',
					LMENUID:'970804',
					isShow:false,
					Children: [{
							img: "/static/images/modify.png",
							name: '修理周期',
							LFUNCNO:'9541',
							isShow:false,
							url:"./Repair/modify/modify",
						},
						{
							img: "/static/images/Sizerecord.png",
							name: '修理记录',
							LFUNCNO:'9556',
							isShow:false,
							url:"./Repair/Sizerecord/Sizerecord",
						}
					],
					id: 3
				}, {
					name: '专件管理',
					LMENUID:'970805',
					isShow:false,
					Children: [{
						img: "/static/images/Typemanagement.png",
						name: '设备类型',
						isShow:true,
						url:"./Repair/TypeAdmin/TypeAdmin",
					}, {
						img: "/static/images/Currentaccount.png",
						name: '基础台账',
						isShow:true,
						url:"./Repair/Current/Current",
					}],
					id: 4
				}],
			}
		},
		computed: {
			...mapGetters([
				'Style', 'Font','BackGround'
			])
		},
		components: {
			ScrollDome,
			chunLeiPopups
		},
		onLoad() {
			// console.log(uni.getStorageSync('tree'));
			let tree = uni.getStorageSync('tree')
			for (let value of tree) {
				if (value.LPARENTID == '00') {
					for (let qq of value.children) {
						if (qq.LMENUID == '9708') {
							for (let hh of qq.children) {
								for(let ww of this.list) {
									if(hh.LMENUID == ww.LMENUID) {
										ww.isShow = true
										for (let qqq of ww.Children) {
											for (let sss of hh.children) {
												if(qqq.LFUNCNO == sss.LFUNCNO) {
													// console.log(qqq);
													qqq.isShow = true
												}
											}
											
										}
									}
								}
							}
						}
					}
				}
			}
		},
		mounted() {

		},
		methods: {
			jumpArchives(item) {
				if (item.index === 0 && item.infoindex === 0) {
					uni.navigateTo({
						url: './archives/archives'
					})
				} else if (item.index === 1) {
					if (item.infoindex === 0) {
						uni.navigateTo({
							url: './period/period'
						})
					} else {
						uni.navigateTo({
							url: './lubrication/lubrication'
						})
					}
				} else if (item.index === 2) {
					if (item.infoindex === 0) {
						uni.navigateTo({
							url: './Wipe/Wipe'
						})
					} else {
						uni.navigateTo({
							url: './WipeRecord/WipeRecord'
						})
					}
				} else if (item.index === 3) {
					if (item.infoindex === 0) {
						uni.navigateTo({
							url: './modify/modify'
						})
					} else {
						uni.navigateTo({
							url: './Sizerecord/Sizerecord'
						})
					}
				} else if (item.index === 4) {
					if (item.infoindex === 0) {
						uni.navigateTo({
							url: './TypeAdmin/TypeAdmin'
						})
					} else {
						uni.navigateTo({
							url: './Current/Current'
						})
					}
				}
			}
		}
	}
</script>

<style lang="scss">
	
</style>
